package com.ym521.demo.view

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Button
import android.widget.TextView
import com.ym521.demo.databinding.ActivityMain2Binding
import kotlin.concurrent.thread

class MainActivity2 : AppCompatActivity() {

    private lateinit var btn: Button
    private lateinit var content: String

    private lateinit var tvContent:TextView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val viewBind = ActivityMain2Binding.inflate(layoutInflater)
        setContentView(viewBind.root)
        btn.text = content
        tvContent.text = "265656"
        viewBind.root.postDelayed({
         val d =   Data("",100)
            viewBind.tvContent.text = d.name
        }, 5 * 1000)
        thread {
            viewBind.tvContent.text = "6565665656565"
        }.start()
    }

    override fun onStart() {
        super.onStart()
        Log.e("MainActivity2", "onStart()")
    }

    data class Data(val a: String, val b: Int) {
        lateinit var name: String
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.e("MainActivity2", "onDestroy()")
    }
}